#ifdef _RMS_TOML_

#include "foo.h"

HANDLE SystemTimerEvent=0;

#ifndef _WIN32_64_
const EventTime kTimerInterval = kEventDurationSecond / 120;	// idle timer interval
pascal void SystemIdleTimer(EventLoopTimerRef inTimer, void *inUserData)
{
    if (SystemTimerEvent) {
        SetEvent(SystemTimerEvent);
    }
}
#endif

void InitFoo()
{
  SystemTimerEvent=CreateEventHandle(NULL, FALSE, FALSE, NULL );
#ifdef _WIN32_64_
  timeSetEvent(3,0,(LPTIMECALLBACK)SystemTimerEvent, 0,TIME_PERIODIC | TIME_CALLBACK_EVENT_SET );
#else
  InstallEventLoopTimer(GetMainEventLoop(), kEventDurationNoWait,kTimerInterval, 
  NewEventLoopTimerUPP(SystemIdleTimer),0,0);
#endif
}



/*DWORD timeGetTime()
{
    unsigned long secs ;
    static UInt64 gMilliAtStart = 0;
    UInt64 dif;
    UInt64 millival=0 ;
    
    
    AbsoluteTime upTime;
    Microseconds(&upTime);
    millival=upTime.hi;
    millival<<=32;
    millival+=upTime.lo;
    
    millival=millival/1000;
            
    if (gMilliAtStart==0) { gMilliAtStart=millival;}
    dif=millival-gMilliAtStart+1;
    return  (DWORD)dif;

}*/

#endif